<template>
  <div>
    <ul>
      <li v-for="m in messages" :key="m.id">
        <!-- <router-link :to="`/home/message/detail/${m.id}?title=${m.title}`">{{m.title}}</router-link> -->
        <router-link :to="{
          name:'chenhongtai',
          params:{id:m.id},
          query:{title:m.title,content:m.content}
        }">{{m.title}}</router-link>
      </li>
  </ul>
  <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'Message',
  data(){
    return{
      messages:[]
    }
  },
  mounted(){
    setTimeout(()=>{
      const messages = [
        {id:1,title:'message001'},
        {id:3,title:'message003'},
        {id:5,title:'message005'},
      ]
      this.messages = messages;
    },1000)
  }
}
</script>

<style scoped>

</style>
